<html lang="ch">
<head>
    <title>123</title>
    <script type="text/javascript">
        window.onload = function () {
            var  submit=  document.getElementById("submit");

            var  pName=  document.getElementById("pName");
            var  spName=  document.getElementById("spName");
            pName.onblur = checkpName;
            function  checkpName(){
                return   check(pName,spName,"供应商名称");
            }

            var  pLinkMan=  document.getElementById("pLinkMan");
            var  spLinkMan=  document.getElementById("spLinkMan");
            pLinkMan.onblur = checkpLinkMan;
            function  checkpLinkMan(){
                return   check(pLinkMan,spLinkMan,"联系人");
            }

            var  pLinkTel=  document.getElementById("pLinkTel");
            var  spLinkTel=  document.getElementById("spLinkTel");
            pLinkTel.onblur = checkpLinkTel;
            function  checkpLinkTel(){
                return   check(pLinkTel,spLinkTel,"联系电话");
            }

            var  pAdderss=  document.getElementById("pAdderss");
            var  spAdderss=  document.getElementById("spAdderss");
            pAdderss.onblur = checkdDesc;
            function  checkdDesc(){
                return   check(pAdderss,spAdderss,"地址");
            }

            var  pBrand=  document.getElementById("pBrand");
            var  spBrand=  document.getElementById("spBrand");
            pBrand.onblur = checkpBrand;
            function  checkpBrand(){
                return   check(pBrand,spBrand,"品牌");
            }


            function  check(view,s,text){
                var value = view.value ;
                if(value==null ||value=="" ){
                    s.innerHTML=text+"不能为空";
                    view.focus();
                    return  false;
                }
                else{
                    s.innerHTML="";
                    return true;
                }
            }

            submit.onclick = function () {
                if (checkpName() && checkpLinkMan() && checkpLinkTel()
                    && checkdDesc() && checkpBrand()){
                    return  true;
                }
                return  false;
            }
        }
    </script>
    <style type="text/css">
        span{
            color:red ;
        }
        body
        {
            background-size: 100% 100%;
            height: 100%;
            width: 100%;
            text-align: center;
            margin-top: 50px;
            margin-left: auto;
        }
        table{
            text-align: center;
            margin: auto;
            text-decoration-color: #E3E6EB;
        }
        h1{
            font-size: 35px;
            color: #5d5a8b;
        }
    </style>
</head>
<body background="/static/img/7.jpg" >
<h1>修改供应商信息</h1>
<form action="/record/updateprovider" method="post">
    <input type="hidden" name="pId" value="${provider.pId}">
    <table cellpadding="4" cellspacing="1" >
        <tr>
            <td>供应商名称：</td>
            <td><input type="text" value="${provider.pName}" name="pName" id="pName"/><span id="spName"></span></td>
        </tr>
        <tr>
            <td>联系人：</td>
            <td><input type="text" value="${provider.pLinkMan}" name="pLinkMan" id="pLinkMan"/><span id="spLinkMan"></span></td>
        </tr>
        <tr>
            <td>联系电话：</td>
            <td><input type="text" value="${provider.pLinkTel}" name="pLinkTel" id="pLinkTel"/><span id="spLinkTel"></span></td>
        </tr>
        <tr>
            <td>地址：</td>
            <td><input type="text" value="${provider.pAdderss}" name="pAdderss" id="pAdderss"><span id="spAdderss"></span></td>
        </tr>
        <tr>
            <td>品牌：</td>
            <td><textarea name="pBrand" placeholder="请输入经验品牌" id="pBrand">${provider.pBrand}</textarea><span id="spBrand"></span> </td>
        </tr>
        <tr>
            <td colspan="2" style="text-align: center">
                <input type="submit" value="保存" id="submit">
            <input type="button" onclick="location.href='/record/selectproviderlist'" value="返回"></td>
        </tr>
    </table>
</form>

</body>
</html>